/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;

/**
 *
 * @author Wx
 */
@Entity
public class Inquiry implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private Timestamp inquiryDate;
    @OneToMany(cascade = {CascadeType.ALL}, fetch=FetchType.EAGER)
    private List<InquiryItem> inquiryItems = new ArrayList<InquiryItem>();
    private String status;

    public Inquiry() {
    }

    public Inquiry(Timestamp date) {
        this.inquiryDate = date;
        this.status = "Pending";
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return the date
     */
    public Timestamp getInquiryDate() {
        return inquiryDate;
    }

    /**
     * @param date the date to set
     */
    public void setInquiryDate(Timestamp inquiryDate) {
        this.inquiryDate = inquiryDate;
    }

    /**
     * @return the inquiryItems
     */
    public List<InquiryItem> getInquiryItems() {
        return inquiryItems;
    }

    /**
     * @param inquiryItems the inquiryItems to set
     */
    public void setInquiryItems(List<InquiryItem> inquiryItems) {
        this.inquiryItems = inquiryItems;
    }

    /**
     * @return the status
     */
    public String getStatus() {
        return status;
    }

    /**
     * @param status the status to set
     */
    public void setStatus(String status) {
        this.status = status;
    }
}
